* This do file replicates Fig S3

use FigS3data.dta, clear

*gen difference in frequencies
egen totreal=total(occ_real)
egen tothat=total(dhat)
gen freq_occ_real=occ_real/totreal
gen freq_occ_hat=dhat/tothat
gen delta=freq_occ_hat - freq_occ_real


*Trick Stata to shift the first bar to the right and allow label 
set obs 10
replace delta=0 in 10
replace isco88_1d_names=" " in 10
gen deltasort=delta
replace deltasort=-1 if isco88_1d_names==" "

keep isco88* delta deltasort

*produce the graph for submission Predicted MINUS Real
graph bar (asis) delta,  bar(1, fcolor(gs8) lcolor(gs8)) over(isco88_1d_names, sort(deltasort) label(angle(forty_five))) ylabel(, nogrid)  graphregion(fcolor(white)) saving(predVSreal_1dISCO, replace)
graph export predVSreal_1dISCO.png, replace width(2000) 






